package com.chujian.system.sys.service.impl;

import com.chujian.framework.core.base.BaseServiceImpl;
import com.chujian.sys.entity.SysRole;
import com.chujian.system.sys.mapper.SysRoleMapper;
import com.chujian.system.sys.service.SysRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import java.util.stream.Collectors;


/**
 * 角色表 服务实现类
 *
 * @author chujian
 * @since 2021-07-28
 */
@Service
@Slf4j
public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {

    @Override
    public Map<Serializable, String> getEchoData(Collection<Serializable> ids) {
        return this.listByIds(ids)
                .stream()
                .collect(Collectors.toMap(SysRole::getId, SysRole::getRoleName));
    }
}
